package com.zhangtai.modules.service.promotion;


import com.zhangtai.modules.dto.PromotionEntityDto;
import com.zhangtai.modules.entity.employee.PromotionEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-08-04 11:02:39
 */

public interface PromotionService {

    @GetMapping("/findPromotionList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/findPromotionListByOriginal")
    @ApiOperation(value = "原生分页查询")
    PageResult<PromotionEntityDto> queryPage(@Param("promotionType")Integer promotionType, @RequestParam(value ="userCode")String userCode,
                                             @RequestParam(value ="name")String name, @RequestParam(value ="orgName")String orgName,
                                             @RequestParam(value ="departmentName")String departmentName, @RequestParam(value ="expeditionStatus")Integer expeditionStatus,
                                             @RequestParam(value ="isDistribute")Integer isDistribute,
                                             @RequestParam(value ="orgIds")List<Long> orgIds, @RequestParam(value ="promotionKind")Integer promotionKind,
                                             @RequestParam(value ="isSelf")Integer isSelf,
                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                             @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                             @RequestParam(value = "status",required = false)Integer status
    );


    @GetMapping("/infoPromotion")
    @ApiOperation(value = "根据id查找")
    PromotionEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/savePromotion")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody PromotionEntity entity);

    @PostMapping("/updatePromotion")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody PromotionEntity entity);

    @GetMapping("/deleteOnePromotion")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deletePromotions")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

